﻿<%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="SalesLog.aspx.cs" Inherits="Sales_SalesLog" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phMain" Runat="Server">
<fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
        <legend>搜索条件</legend>地区：
        <asp:DropDownList ID="ddlRegion" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource2" DataTextField="RegionName" DataValueField="RegionID">
        </asp:DropDownList>
        餐厅：
        <asp:DropDownList ID="ddlStore" runat="server" DataSourceID="ObjectDataSource1" DataTextField="StoreName" DataValueField="StoreID">
        </asp:DropDownList>
        营运日期：
        <asp:TextBox ID="txtBeginDate" runat="server"></asp:TextBox>
        <asp:RangeValidator ID="RangeValidator1" runat="server" Display="Dynamic" ErrorMessage="*必须为2000-1-1至2100-1-1"
            ControlToValidate="txtBeginDate" MaximumValue="2100-1-1" MinimumValue="2000-1-1"
            SetFocusOnError="True" Type="Date"></asp:RangeValidator>至：<asp:TextBox ID="txtEndDate"
                runat="server"></asp:TextBox>
        <asp:RangeValidator ID="RangeValidator2" runat="server" Display="Dynamic" ErrorMessage="*必须为2000-1-1至2100-1-1"
            ControlToValidate="txtEndDate" MaximumValue="2100-1-1" MinimumValue="2000-1-1"
            SetFocusOnError="True" Type="Date"></asp:RangeValidator>
            <asp:Button ID="btnQuery" Text="查询" runat="server" />
    </fieldset>
    <fieldset style="margin: 10px 10px 10px 10px; padding: 5px 5px 5px 5px;">
    <asp:GridView ID="GridView1" runat="server" BorderWidth="1px" EmptyDataText="找不到批配的数据"
        HorizontalAlign="Center" Width="100%" AutoGenerateColumns="False"  AllowPaging="True" DataSourceID="ObjectDataSource3">
        <EmptyDataRowStyle BackColor="#0000C0" Font-Bold="True" Font-Size="12pt" ForeColor="White" />
        <HeaderStyle BackColor="Gray" />
        <AlternatingRowStyle BackColor="#E0E0E0" />
        <EditRowStyle ForeColor="White" />
        <Columns>
            <asp:BoundField DataField="StoreID" HeaderText="餐厅编号" SortExpression="StoreID" />
            <asp:BoundField DataField="StoreName" HeaderText="餐厅名称" SortExpression="StoreName" />
            <asp:BoundField DataField="OperationDate" HeaderText="营运日期" SortExpression="OperationDate" />
            <asp:BoundField DataField="TotalSales" HeaderText="TotalSales" SortExpression="TotalSales" />
            <asp:BoundField DataField="TotalTC" HeaderText="TotalTC" SortExpression="TotalTC" />
            <asp:BoundField DataField="DinnerSales" HeaderText="DinnerSales" SortExpression="DinnerSales" />
            <asp:BoundField DataField="DinnerTC" HeaderText="DinnerTC" SortExpression="DinnerTC" />
            <asp:BoundField DataField="TakeAwaySales" HeaderText="TakeAwaySales" SortExpression="TakeAwaySales" />
            <asp:BoundField DataField="TakeAwayTC" HeaderText="TakeAwayTC" SortExpression="TakeAwayTC" />
            <asp:BoundField DataField="DeliverySales" HeaderText="DeliverySales" SortExpression="DeliverySales" />
            <asp:BoundField DataField="DeliveryTC" HeaderText="DeliveryTC" SortExpression="DeliveryTC" />
            <asp:BoundField DataField="Water" HeaderText="水" SortExpression="Water" />
            <asp:BoundField DataField="Electricity" HeaderText="电" SortExpression="Electricity" />
            <asp:BoundField DataField="Gas" HeaderText="气" SortExpression="Gas" />
            <asp:BoundField DataField="LaborHour" HeaderText="工时" SortExpression="LaborHour" />
            <asp:BoundField DataField="P1" HeaderText="产品1" SortExpression="P1" />
            <asp:BoundField DataField="P2" HeaderText="产品2" SortExpression="P2" />
            <asp:BoundField DataField="P3" HeaderText="产品3" SortExpression="P3" />
            <asp:BoundField DataField="P4" HeaderText="产品4" SortExpression="P4" />
            <asp:BoundField DataField="P5" HeaderText="产品5" SortExpression="P5" />
            <asp:BoundField DataField="P6" HeaderText="产品6" SortExpression="P6" />
            <asp:BoundField DataField="P7" HeaderText="产品7" SortExpression="P7" />
            <asp:BoundField DataField="P8" HeaderText="产品8" SortExpression="P8" />
            <asp:BoundField DataField="P9" HeaderText="产品9" SortExpression="P9" />
            <asp:BoundField DataField="P10" HeaderText="产品10" SortExpression="P10" />
            <asp:BoundField DataField="OperationReport" HeaderText="OperationReport" SortExpression="OperationReport" />
            <asp:BoundField DataField="EventReport" HeaderText="EventReport" SortExpression="EventReport" />
            <asp:BoundField DataField="MarketingReport" HeaderText="MarketingReport" SortExpression="MarketingReport" />
            <asp:BoundField DataField="RepairReport" HeaderText="RepairReport" SortExpression="RepairReport" />
        </Columns>
    </asp:GridView>
    </fieldset>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetStoresByRegionID"
        TypeName="BaseInfoDB">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlRegion" Name="RegionID" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetRegions"
        TypeName="BaseInfoDB"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="getSalesLogsByCondition"
        TypeName="Inventory">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlRegion" Name="RegionID" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:ControlParameter ControlID="ddlStore" Name="StoreID" PropertyName="SelectedValue"
                Type="String" />
            <asp:ControlParameter ControlID="txtBeginDate" Name="beginDate" PropertyName="Text"
                Type="DateTime" />
            <asp:ControlParameter ControlID="txtEndDate" Name="endDate" PropertyName="Text" Type="DateTime" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

